<?php $model = Reviews::model()->findAllByAttributes(array('status' => SkillConfig::STATUS_ACTIVE)) ?>
<section id="userTestimonial" class="contentCntr rempaddingT">
    <div class="container">
        <div class="row">
            <div class="span12">            	
                <div class="reviewBox">                	
                    <h4 class="txttTransformNorml">Testimonials and Reviews
                        <span id="testimonial-crousl-nav" class="crsl-nav">
                            <a href="javascript:void(0);" class="previous"><img src="<?php echo ThemePath(); ?>/images/slide-right.png" /></a>
                            <a href="javascript:void(0);" class="next"><img src="<?php echo ThemePath(); ?>/images/slide-left.png" /></a>
                        </span>
                    </h4>
                    <div class="padding20px">
                        <div class="height1px borB"></div>
                        <div class="testimonial-crousl" data-navigation="testimonial-crousl-nav">
                            <?php if (!empty($model)) { ?>
                                <ul class="crsl-wrap">
                                    <?php
                                    foreach ($model as $reviewsVal) {
                                        if ($reviewsVal->users->profiles[0]->photo <> "") {
                                            $imgsrc = baseUrl() . '../../' . getUploadDir() . $reviewsVal->users_id . '/profile/minithumb/' . $reviewsVal->users->profiles[0]->photo;
                                        } else {
                                            $imgsrc = baseUrl() . '../../upload/default-mini.png';
                                        }
                                        ?>
                                        <li class="crsl-item">
                                            <span class="floatL"><img src="<?php echo $imgsrc; ?>" /></span>
                                            <div class="userReview">
                                                <p class="fnt-size20 fntweghtBld font-opensansilt txtfff"><?php
                                echo (!empty($reviewsVal->users->profiles[0]->first_name)) ? $reviewsVal->users->profiles[0]->first_name : '';
                                echo '   ' . (!empty($reviewsVal->users->profiles[0]->last_name)) ? $reviewsVal->users->profiles[0]->last_name : '';
                                ?></p>
                                                <p class="fnt-size14 fntweghtBld font-opensansilt txtfff"><?php echo (!empty($reviewsVal->classes->class_titile)) ? WORK_SHOP_NAME .' '. $reviewsVal->classes->class_titile : COURSE_NAME .' '. $reviewsVal->courses->course_titile; ?></p>
                                                <p class="fnt-size14 font-opensansilt txtfff"><?php echo $reviewsVal->reviews_text; ?></p>
                                                <p class="fnt-size14 font-opensansilt txtfff remmarginB"><?php echo $reviewsVal->create_time; ?></p>
                                            </div>
                                        </li>   
                                <?php } ?>
                                </ul>
<?php } ?>
                        </div>  
                        <div class="height1px borB"></div>  
                        <a class="floatR txtfff font-opensansilt" href="<?php echo $this->createAbsoluteUrl('/reviews/testimonials') ?>">See All</a>
                        <div class="clear"></div>
                    </div>                                                                    
                </div>
            </div>
        </div>
    </div>
</section>